var stepLength = 217;
var scrollStep=2;
var timerLeft="";
var timerRight="";
var timerout = 5;
var stepOneTime = 0;
function scrollDivLeft(id){
	clearTimeout(timerLeft) ;
	var width =document.getElementById(id).scrollLeft;
	document.getElementById(id).scrollLeft+=scrollStep;
	 timerLeft=setInterval("scrollDivLeft('"+id+"')",timerout);
	 stepOneTime += scrollStep;
	if(stepOneTime >= stepLength){
		clearTimeout(timerLeft);
		stepOneTime = 0;
	}
	if((width + stepLength*4) >= $("#inside").width()-15){ 
		$(".righta").css("display","block");
		$(".lefta").css("display","none");
	}else{
		$(".righta").css("display","block");
		$(".lefta").css("display","block");
	}
}
function scrollDivRight(id){
	clearTimeout(timerRight) ;
	var width =document.getElementById(id).scrollLeft;
	document.getElementById(id).scrollLeft -= scrollStep;
	 timerRight=setInterval("scrollDivRight('"+id+"')",timerout);
	 stepOneTime += scrollStep;
	if(stepOneTime >= stepLength){
		clearTimeout(timerRight);
		stepOneTime = 0;
	}
	if(width - stepLength <=0){
		$(".righta").css("display","none");
		$(".lefta").css("display","block");
	}else{
		$(".righta").css("display","block");
		$(".lefta").css("display","block");
	}
}